import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooMinishopCouponsController } from '../../../controllers';
const uctoominishopCouponsRouter = new Router();
const minishopCouponsController = new uctooMinishopCouponsController();

uctoominishopCouponsRouter.post('/add', requireUser, minishopCouponsController.add);
uctoominishopCouponsRouter.post('/edit', requireUser, rowLevelPermission('uctoo/minishop_coupons'), minishopCouponsController.edit);
uctoominishopCouponsRouter.post('/del', requireUser, rowLevelPermission('uctoo/minishop_coupons'), minishopCouponsController.delete);

//For getting minishopCoupons with permission control
uctoominishopCouponsRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/minishop_coupons'), minishopCouponsController.getSingle);
uctoominishopCouponsRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/minishop_coupons'), minishopCouponsController.getMany);
uctoominishopCouponsRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/minishop_coupons'), minishopCouponsController.getMany);

//#endregion AutoCreateCode
export default uctoominishopCouponsRouter;
